#ifndef _WT_TABLE_CMDS_H
#define _WT_TABLE_CMDS_H

typedef enum {
  WT_TBL_CMD_DONE,
  WT_TBL_CMD_MISSING,
  WT_TBL_CMD_NOT_FOUND
} WtTblCmdStatus;

void WtCreateTableCmd(Tcl_Interp *interp, const char *cmdName, Tcl_Obj *tbl);

int WtNamedTableCmd(ClientData clientData, Tcl_Interp *interp,
                    int objc, Tcl_Obj *const objv[]);

int WtTableToArray(Tcl_Interp *interp, Tcl_Obj *table, Tcl_Obj *arrName,
                   int multiVals);

Tcl_Obj *WtTblCmdGetTable(Tcl_Interp *interp, Tcl_Obj *obj, int *created, Tcl_ObjType *type);

WtTblCmdStatus WtTblCmdHelper(ClientData clientData, Tcl_Interp *interp,
                              int objc, Tcl_Obj *const objv[], int *tclResult,
                              Tcl_ObjType *type, int readOnly, int appendUsage);

void WtTblCmdUsageError(Tcl_Interp *interp, Tcl_Obj *cmd, int readOnly);

void WtTblCmdAppendUsage(Tcl_Interp *interp, Tcl_Obj *cmd, int readOnly);

int WtTableCmd(ClientData clientData, Tcl_Interp *interp,
               int objc, Tcl_Obj *const objv[]);

int WtStringTableCmd(ClientData clientData, Tcl_Interp *interp,
                     int objc, Tcl_Obj *const objv[]);

WtTblCmdStatus WtTblMethodHelper(ClientData clientData, Tcl_Interp *interp,
                                 int objc, Tcl_Obj *const objv[], int *tclResult,
                                 Tcl_Obj *table, int readOnly, int appendUsage);

void WtTblMethodUsageError(Tcl_Interp *interp, Tcl_Obj *cmd, int readOnly);

void WtTblMethodAppendUsage(Tcl_Interp *interp, Tcl_Obj *cmd, int readOnly);

void WtInitTableCommands(Tcl_Interp *interp);

#endif /* !_WT_TABLE_CMDS_H */
